@echo off
echo Building Ionic app for HarmonyOS...

REM Build Ionic application
echo Building Ionic application...
call ionic build --prod

REM Create ionic directory in rawfile
if not exist "ohos\entry\src\main\resources\rawfile\ionic" (
    mkdir "ohos\entry\src\main\resources\rawfile\ionic"
)

REM Copy built files to HarmonyOS rawfile directory
echo Copying built files to HarmonyOS project...
xcopy /E /Y "dist\*" "ohos\entry\src\main\resources\rawfile\ionic\"

echo Build completed successfully!
echo You can now build the HarmonyOS application using DevEco Studio.
pause